<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>所有文章</title>
  <link rel="stylesheet" href="/assets/css/iconfont.css">
  <link rel="stylesheet" href="/assets/libs/bootstrap.min.css">
  <link rel="stylesheet" href="/assets/css/base.css">
  <link rel="stylesheet" href="/assets/css/ad-public.css">
  <link rel="stylesheet" href="/assets/css/ad-public.css">
  <link rel="stylesheet" href="/assets/css/posts.css">
</head>

<body>
  <!-- 侧边栏 -->
  @@include('../assets/common/admin/adminNav.html')


  <!-- 主体 -->
  <div class="main">
    <!-- 头部 -->
    @@include('../assets/common/admin/adminMainHeader.html')
    <!-- 内容区 -->
    <div class="content">
      <div class="page-title">
        <h3>所有文章</h3>
        <a href="post-add.html" class="btn btn-primary btn-xs">写文章</a>
      </div>
      <div class="page-hander">
        <a class="btn btn-danger btn-sm" href="javascript:;" style="display: none">批量删除</a>
        <form class="form-inline">
          <select name="" class="form-control input-sm select">

          </select>
          <select name="" class="form-control input-sm status">
            <option value="0">草稿</option>
            <option value="1">已发布</option>
          </select>
          <button type="submit" class="btn btn-default btn-sm select-btn">筛选</button>
        </form>
        <ul class="pagination pagination-sm pull-right">
          <li><a href="#">上一页</a></li>
          <li><a href="#">1</a></li>
          <li><a href="#">2</a></li>
          <li><a href="#">3</a></li>
          <li><a href="#">下一页</a></li>
        </ul>
      </div>

      <table class="table table-striped table-bordered table-hover">
        <thead>
          <tr>
            <th>标题</th>
            <th>作者</th>
            <th>分类</th>
            <th class="text-center">发表时间</th>
            <th class="text-center">状态</th>
            <th class="text-center" width="100">操作</th>
          </tr>
        </thead>
        <tbody>


        </tbody>
      </table>
    </div>
  </div>

  <!-- 删除模态框 -->
  <div class="modul hide">
    <div class="mosk"></div>
    <div class="content">
      <div class="item">
        <h3>确定要删除吗？</h3>
      </div>
      <div class="btn">
        <a href="javascript:;" class="delete">删除</a>
        <a href="javascript:;" class="cancel">取消</a>
      </div>
    </div>
  </div>



  @@include('../assets/common/adminBase.html')

  <!-- 所有文章模板 -->
  <script type="text/template" id="postsTempalte">
    {{each result}}
    <tr>
      <td>{{$value.title}}</td>
      <td>{{$value.author.nickName?value.author.nickName:""}}</td>
      <td>{{$value.category.title?$value.category.title:""}}</td>
      <td class="text-center">{{handleDate($value.author.createTime)}}</td>
      <td class="text-center">{{$value.state===1?'已发布':'草稿'}}</td>
      <td class="text-center delete-td">
        <a href="post-add.html?id={{$value._id}}" class="btn btn-default btn-xs">编辑</a>
        <a href="javascript:;" data-id={{$value._id}} class="btn btn-danger btn-xs delete">删除</a>
      </td>
    </tr>
    {{/each}}
  </script>

  <!-- 分类列表模板 -->
  <script type="text/template" id="cateTemplate">
    {{each result}}
    <option value="{{$value._id}}" >{{$value.title}}</option>
    {{/each}}
  </script>

  <script src="../js/admin/posts.js"></script>

</body>

</html>